<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 1.lazy 绑定change事件 -->
        <input type="text" v-model.lazy="message">
        <p>你输入的为{{message}}</p>
        <!-- 2.number 绑定数字事件 -->
        <input type="text" v-model.number="count">
        <p>你输入的数字为{{count}} - {{typeof count}}</p>
        <!-- 3.string -->
        <!-- 4.trim去除首尾空格 -->
        <input type="text" v-model.lazy.trim="content">
        <p>你输入的为{{content}}</p>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        //用vue创建app
        const app = Vue.createApp({
            // template: `

            // `,
            data() {
                return {
                    message:" ",
                    count:0,
                    content:""
                }
            },
            methods: {
    
            },
            watch: {
                content(newValue) {
                    console.log("content:",newValue);
                }
            }
        })
        //挂载app
        app.mount("#app")
    </script>

</body>

</html>